﻿/*------------------------------------------------
// File Description: SortRule DataBase Entity
// Author:			 Crane
// Create Time:		 2020-12-26 15:15:08
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 组件分拣规则
    /// </summary>
    [Table(nameof(SortRule))]
    public class SortRule : BaseEntity
    {
        private string _workshopCode = string.Empty;
        private string _workshopName = string.Empty;
        private string _machineNo = string.Empty;
        private string _machineName = string.Empty;
        private string _orderNo = string.Empty;
        private string _workOrderNo = string.Empty;
        private string _nameplateModel = string.Empty;
        private string _currentLevel = string.Empty;
        private string _qLevel = string.Empty;
        private string _componentColor = string.Empty;
        private string _junBoxSpecs = string.Empty;
        private string _junBoxFactory = string.Empty;
        private string _backPlanSpecs = string.Empty;
        private string _backPlanFactory = string.Empty;
        private string _aluFrameSpecs = string.Empty;
        private string _aluFrameFactory = string.Empty;
        private string _batterySpecs = string.Empty;
        private string _batteryFactory = string.Empty;
        private string _powerLevel = string.Empty;
        private string _lineName = string.Empty;
        private string _badReason = string.Empty;

        #region Public Property

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 流水线ID
        ///</Summary>
        public int LineId { get; set; }

        ///<Summary>
        /// 流水线名称
        ///</Summary>
        public string LineName
        {
            get { return string.IsNullOrWhiteSpace(_lineName) ? string.Empty : _lineName; }
            set { _lineName = value; }
        }

        ///<Summary>
        /// 设备ID
        ///</Summary>
        public int MachineId { get; set; }

        ///<Summary>
        /// 分拣机编码
        ///</Summary>
        public string MachineNo
        {
            get { return string.IsNullOrWhiteSpace(_machineNo) ? string.Empty : _machineNo; }
            set { _machineNo = value; }
        }

        ///<Summary>
        /// 分拣机名称
        ///</Summary>
        public string MachineName
        {
            get { return string.IsNullOrWhiteSpace(_machineName) ? string.Empty : _machineName; }
            set { _machineName = value; }
        }

        ///<Summary>
        /// 堆号
        ///</Summary>
        public int StackNo { get; set; }

        ///<Summary>
        /// 满托数量
        ///</Summary>
        public int FullCount { get; set; }

        ///<Summary>
        /// 订单号校验
        ///</Summary>
        public bool OrderNoCheck { get; set; }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 工单号校验
        ///</Summary>
        public bool WorkOrderNoCheck { get; set; }

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 铭牌型号校验
        ///</Summary>
        public bool NameplateModelCheck { get; set; }

        ///<Summary>
        /// 铭牌型号
        ///</Summary>
        public string NameplateModel
        {
            get { return string.IsNullOrWhiteSpace(_nameplateModel) ? string.Empty : _nameplateModel; }
            set { _nameplateModel = value; }
        }

        ///<Summary>
        /// 功率档校验
        ///</Summary>
        public bool PowerLevelCheck { get; set; }

        ///<Summary>
        /// 功率档
        ///</Summary>
        public string PowerLevel
        {
            get { return string.IsNullOrWhiteSpace(_powerLevel) ? string.Empty : _powerLevel; }
            set { _powerLevel = value; }
        }

        ///<Summary>
        /// 电流档校验
        ///</Summary>
        public bool CurrentLevelCheck { get; set; }

        ///<Summary>
        /// 电流档
        ///</Summary>
        public string CurrentLevel
        {
            get { return string.IsNullOrWhiteSpace(_currentLevel) ? string.Empty : _currentLevel; }
            set { _currentLevel = value; }
        }

        ///<Summary>
        /// 质量等级校验
        ///</Summary>
        public bool QLevelCheck { get; set; }

        ///<Summary>
        /// 质量等级
        ///</Summary>
        public string QLevel
        {
            get { return string.IsNullOrWhiteSpace(_qLevel) ? string.Empty : _qLevel; }
            set { _qLevel = value; }
        }

        ///<Summary>
        /// 组件颜色校验
        ///</Summary>
        public bool ComponentColorCheck { get; set; }

        ///<Summary>
        /// 组件颜色
        ///</Summary>
        public string ComponentColor
        {
            get { return string.IsNullOrWhiteSpace(_componentColor) ? string.Empty : _componentColor; }
            set { _componentColor = value; }
        }

        ///<Summary>
        /// 接线盒规格校验
        ///</Summary>
        public bool JunBoxSpecsCheck { get; set; }

        ///<Summary>
        /// 接线盒规格
        ///</Summary>
        public string JunBoxSpecs
        {
            get { return string.IsNullOrWhiteSpace(_junBoxSpecs) ? string.Empty : _junBoxSpecs; }
            set { _junBoxSpecs = value; }
        }

        ///<Summary>
        /// 接线盒厂家校验
        ///</Summary>
        public bool JunBoxFactoryCheck { get; set; }

        ///<Summary>
        /// 接线盒厂家
        ///</Summary>
        public string JunBoxFactory
        {
            get { return string.IsNullOrWhiteSpace(_junBoxFactory) ? string.Empty : _junBoxFactory; }
            set { _junBoxFactory = value; }
        }

        ///<Summary>
        /// 背板规格校验
        ///</Summary>
        public bool BackPlanSpecsCheck { get; set; }

        ///<Summary>
        /// 背板规格
        ///</Summary>
        public string BackPlanSpecs
        {
            get { return string.IsNullOrWhiteSpace(_backPlanSpecs) ? string.Empty : _backPlanSpecs; }
            set { _backPlanSpecs = value; }
        }

        ///<Summary>
        /// 背板厂家校验
        ///</Summary>
        public bool BackPlanFactoryCheck { get; set; }

        ///<Summary>
        /// 背板厂家
        ///</Summary>
        public string BackPlanFactory
        {
            get { return string.IsNullOrWhiteSpace(_backPlanFactory) ? string.Empty : _backPlanFactory; }
            set { _backPlanFactory = value; }
        }

        ///<Summary>
        /// 铝框规格校验
        ///</Summary>
        public bool AluFrameSpecsCheck { get; set; }

        ///<Summary>
        /// 铝框规格
        ///</Summary>
        public string AluFrameSpecs
        {
            get { return string.IsNullOrWhiteSpace(_aluFrameSpecs) ? string.Empty : _aluFrameSpecs; }
            set { _aluFrameSpecs = value; }
        }

        ///<Summary>
        /// 铝框厂家校验
        ///</Summary>
        public bool AluFrameFactoryCheck { get; set; }

        ///<Summary>
        /// 铝框厂家
        ///</Summary>
        public string AluFrameFactory
        {
            get { return string.IsNullOrWhiteSpace(_aluFrameFactory) ? string.Empty : _aluFrameFactory; }
            set { _aluFrameFactory = value; }
        }

        ///<Summary>
        /// 电池片规格校验
        ///</Summary>
        public bool BatterySpecsCheck { get; set; }

        ///<Summary>
        /// 电池片规格
        ///</Summary>
        public string BatterySpecs
        {
            get { return string.IsNullOrWhiteSpace(_batterySpecs) ? string.Empty : _batterySpecs; }
            set { _batterySpecs = value; }
        }

        ///<Summary>
        /// 电池片厂家校验
        ///</Summary>
        public bool BatteryFactoryCheck { get; set; }

        ///<Summary>
        /// 电池片厂家
        ///</Summary>
        public string BatteryFactory
        {
            get { return string.IsNullOrWhiteSpace(_batteryFactory) ? string.Empty : _batteryFactory; }
            set { _batteryFactory = value; }
        }

        ///<Summary>
        /// 异常校验
        ///</Summary>
        public bool BadReasonCheck { get; set; }

        ///<Summary>
        /// 异常
        ///</Summary>
        public string BadReason
        {
            get { return string.IsNullOrWhiteSpace(_badReason) ? string.Empty : _badReason; }
            set { _badReason = value; }
        }

        ///<Summary>
        /// 状态
        ///</Summary>
        public Enum.SortRuleStatus Status { get; set; } = Enum.SortRuleStatus.Valid;
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 组件分拣规则
        /// </summary>
        public virtual DbSet<SortRule> SortRules { get; set; }
    }
}